package com.qqt.csr.archive.entity.writer.content;

import com.qqt.csr.archive.enums.ImageFormatType;
import com.qqt.csr.archive.enums.ImageType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * @Author: yang hao
 * @Date: 2024/11/19 9:52
 * @Description: 图文消息内容
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "图文消息内容")
public class ImageElemContent implements MsgContent {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "图片格式")
    private ImageFormatType imageFormat;

    @Schema(description = "图片信息数组")
    private List<ImageInfo> imageInfoArray;

    /**
     * 图片信息
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @Schema(description = "图片信息")
    public static class ImageInfo implements Serializable {

        @Serial
        private static final long serialVersionUID = 1L;

        @Schema(description = "图片类型")
        private ImageType type;

        @Schema(description = "图片数据大小，单位：字节")
        private Number size;

        @Schema(description = "图片宽度，单位为像素")
        private Number width;

        @Schema(description = "图片高度，单位为像素")
        private Number height;

        @Schema(description = "图片下载地址")
        private String url;

    }
}
